﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;

namespace Tetris
{
    class Tcp_Listener
    {
        public static void listenTcp()
        {
            TcpListener server = new TcpListener(IPAddress.Any, 50000);
            server.Start();
            TcpClient client = server.AcceptTcpClient();
            NetworkStream stream = client.GetStream();
            BinaryFormatter formatter = new BinaryFormatter();
            while (true)
            {
                Tetris.gameMulti =(Game)formatter.Deserialize(stream);
            }
        }
    }
}
